package cn.train.service;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import cn.train.dao.IAdminGuanLi;
import cn.train.model.Admin;
import cn.train.util.SqlSessionFactoryUtil;

public class AdminServices {
	SqlSession session=SqlSessionFactoryUtil.getSqlSession();
	IAdminGuanLi admin=session.getMapper(IAdminGuanLi.class);
	
	public List<Admin> AllAdmin(int pageIndex,int pageSize){
		pageIndex=(pageIndex-1)*pageSize;
		return admin.AllAdmin( pageIndex,pageSize);
	}
	public int getCount(){
		return admin.getcount();
	}
	@Test
	public void test(){
		int m=admin.getcount();
		List<Admin> list=admin.AllAdmin(0, 2);
		System.out.println(list);
		for (Admin admin : list) {
			System.out.println(admin.getAname());
		}
		
	}
}
